package com.feihao.zhou.demo1;

import java.util.ArrayList;
import java.util.Collection;
import java.util.function.Predicate;

public class CollectionTest {
    public static void main(String[] args) {
        Collection<Integer> collection = new ArrayList<>();
        collection.add(45);
        collection.add(44);
        collection.add(4555);

        collection.removeIf(
                new Predicate<Integer>() {
                    @Override
                    public boolean test(Integer integer) {
                        return (integer == 45);
                    }
                }
        );

        //返回的是boolean值
        boolean remove = collection.remove(44);

        System.out.println(collection);
    }
}
